{{css "/libs/bootstrap/dist/css/bootstrap.css, /libs/font-awesome/css/font-awesome.css, /libs/animate.css/animate.css,/css/base.css,/css/collection.css"
}} {{js "/libs/jquery/dist/jquery.js, /libs/bootstrap/dist/js/bootstrap.js,/js/collection.js"}}

<div class="container-fluid editor-page">
    <div class="row">
        <div class="col-md-offset-2 col-md-10">
            <table class="table table-bordered">
                <thead>
                    <tr>
                        <th>
                            作品名字
                        </th>
                        <th>
                            作品的url
                        </th>
                        <th>
                            作品的标签
                        </th>
                        <th>
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    {{#each collections}}
                    <tr id={{_id}}>
                        <td>
                            {{name}}
                        </td>
                        <td>
                            <a href={{url}}>{{url}}</a>
                        </td>
                        <td class="collection-labels">
                           <input type="hidden" value={{#each labels}}{{this}},{{/each}} > </input> 
                            {{#each labels}}
                            <a href="/admin/collection/{{this}}/">{{this}}</a> {{/each}}
                        </td>
                        <td>
                            <button class="btn btn-primary btn-update">更改</button>
                            <button class="btn btn-error btn-del">删除</button>
                        </td>

                    </tr>
                    {{/each}}
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="4" class="text-right"> <button class="btn btn-primary" href="#modal-add" data-toggle="modal">新增</button></td>
                    </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>

<div id="modal-add" class="modal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <a class="close" data-dismiss="modal"></a>
            </div>
            <div class="modal-body">
                <form>
                    <div class="form-group">
                        <label>  作品名字</label><input name="essay-name" class="form-control" />
                    </div>
                    <div class="form-group">
                        <label>  作品url</label><input name="essay-url" class="form-control" />
                    </div>
                    <div class="form-group">
                        <label>  标签</label><input name="essay-labels" class="form-control" />
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button id="btn-confirm" class="btn btn-success">确定</button>
                <button class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>